#ifndef __ACCEPTOR_HPP__
#define __ACCEPTOR_HPP__

#include "InetAddress.hpp"
#include "Socket.hpp"
#include <sys/socket.h>

namespace wd{

class Acceptor{
public:
    Acceptor(unsigned short port, string ip);
    int accept();
    int listenfd();

private:
    void ready(); //在构造函数中调用
    void setReuseAddr(bool);
    void setReusePort(bool);
    void bind();
    void listen();

private:
    InetAddress _addr;
    Socket _sock;
};





}


#endif // __ACCEPTOR_HPP__

